package com.suxin.plugin.intergration.manager.user;

import com.suxin.plugin.intergration.manager.plugin.PluginManager;
import org.springframework.context.ApplicationContext;

/**
 * @author Tang
 * @classname DefaultPluginUser
 * @description [  ]
 * @date 2022/7/4 22:39
 */
public class DefaultPluginUser implements PluginUser{

    PluginManager pluginManager;

    ApplicationContext applicationContext;

    public DefaultPluginUser(PluginManager pluginManager, ApplicationContext applicationContext) {
        this.pluginManager = pluginManager;
        this.applicationContext = applicationContext;
    }

    @Override
    public <T> T getBean(String name) {
        return (T)applicationContext.getBean(name);
    }

    @Override
    public <T> T getBean(Class<T> tClass) {
        return applicationContext.getBean(tClass);
    }
}